<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>买到快报</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/swiper.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/layer.css" />
    <link rel="stylesheet" type="text/css" href="../css/mdw.css" />
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../script/swiper.min.js"></script>
    <script type="text/javascript" src="../script/mobile.js"></script>
    <script type="text/javascript" src="../script/layer.js"></script>
    <script type="text/javascript" src="../script/mdw.js"></script>
    <script type="text/javascript" src="../script/jumpPage.js"></script>
</head>
<body >
    <header class="header">
        <div class="backPrevPage" onclick="historyBack()"></div>
        <div class="pageTitle">买到快报</div>
    </header>
    <section class="newsPage HTML_BOX">
        <div class="bg-eee" style="border-bottom:.2rem solid #EEE ; "></div>
        <ul class="newsList">
            <!-- <li onclick="openWin('index_newsDetails','index_newsDetails.html');">
                <div class="newsImage">
                    <img src="../image/news_image1.png"/>
                </div>
                <div class="newsItem">
                    <div class="newsTitle">7月26日上新新品水果限时优惠8.8折活动时间仅限三天</div>
                    <div class="newsActivity">活动时间：2018-07-26至07-29</div>
                    <div class="newsTime">刚刚</div>
                </div>
            </li>
            <li>
                <div class="newsImage">
                    <img src="../image/news_image2.png"/>
                </div>
                <div class="newsItem">
                    <div class="newsTitle">7月26日上新新品水果限时优惠8.8折活动时间仅限三天</div>
                    <div class="newsTime">2018-07-22</div>
                </div>
            </li>
             -->
        </ul>
    </section>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
    apiready = function(){
        $api.fixStatusBar($api.dom('header'));
        api.setStatusBarStyle({
            color: '#fff',//设置APP状态栏背景色
            style: 'dark'
        });
        ifCnAndEn();
        ready();
    };
    var list =[];
    function ready(){
        pop.loading();
        getAjax(Interface.scoll_news,{},function(res){
            list = res.data;
            console.log(JSON.stringify(res));
            $.each(list,function(i,item){
                var html="";
                html+='<li onclick="goxq(\''+i+'\')">';
                        html+='<div class="newsImage">';
                            html+='<img src="'+getImg(item.icon)+'"/>';
                        html+='</div>';
                        html+='<div class="newsItem">';
                            html+='<div class="newsTitle">'+item.title+'</div>';
                            //html+='<div class="newsActivity">活动时间：2018-07-26至07-29</div>';
                            html+='<div class="newsTime">'+timestampToTime(item.create_time)+'</div>';
                        html+='</div>';
                    html+='</li>';
                    $(".newsList").append(html);
            })
            pop.close();
        },function(res,err){})
    }

    function goxq(item){
        openWin('index_newsDetails','index_newsDetails.html',list[item]);
    }

    function timestampToTime(timestamp) {
    //时间戳为10位需*1000，时间戳为13位的话不需乘1000
        var date = new Date(timestamp * 1000);
        Y = date.getFullYear() + '-';
        M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
        D = date.getDate() + ' ';
        return Y+M+D;
    }
</script>
<script type="text/javascript">
    function ifCnAndEn(){
        var html = '';
        if(cnen==2){
            $(".pageTitle").html('News');
            
        }
    }
</script>
</html>